package com.xzsoft.gdwz.services.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xzsoft.gdwz.ps.dao.InqOrderDao;
import com.xzsoft.gdwz.ps.model.Fj;
import com.xzsoft.gdwz.ps.model.InqOrder;
import com.xzsoft.gdwz.ps.model.InqOrderLine;
import com.xzsoft.gdwz.ps.model.InqVendorHeader;
import com.xzsoft.gdwz.ps.model.User;
import com.xzsoft.gdwz.ps.model.psInqRsult;
import com.xzsoft.gdwz.services.InqOrderService;

/**
 * <p>Title: 远程评审</p>
 * <p>Description: </p>
 * <p>Company:兴竹信息 </p>
 * @author:杨   光
 * @date:2016-11-18 上午10:48:29
 */
@Transactional
@Service("inqOrderService")
public class InqOrderServiceImpl implements InqOrderService {

	
	@Autowired
	private InqOrderDao inqOrderDao;
	
	
	
	@ResponseBody
	@Override
	public List<InqOrder> getInqOrder(String createby) {
		System.out.println("查询询价单"+createby);
		List<InqOrder> inqOderlist = new ArrayList<InqOrder>();
		inqOderlist = inqOrderDao.getInqOrder(createby);
		System.out.println(inqOderlist.toString());
		return inqOderlist;
	}

	
	@ResponseBody
	@Override
	public List<InqOrderLine> getInqOrderLine(String inqId) {
		List<InqOrderLine> OrderLinelist = new ArrayList<InqOrderLine>();
		OrderLinelist = inqOrderDao.getInqOrderLine(inqId);
		return OrderLinelist;
	}


	
	@Override
	public User getCreateby(String createby) {
		
		return inqOrderDao.getCountUser(createby);
		
	}


	
	@Override
	public int UpdateInqStatus(String inqId) {
		
		int count = inqOrderDao.updateInqStatus(inqId);
		return count;
	}


	@ResponseBody
	@Override
	public List<InqVendorHeader> getInqVendorHeader(String inqId) {
		List<InqVendorHeader> VendorHeaderlist = new ArrayList<InqVendorHeader>();
		VendorHeaderlist = inqOrderDao.getInqVendorHeader(inqId);
		return VendorHeaderlist;
	}


	
	@Override
	public List<Fj> getFile(String inqId) {
		List<Fj> fjlist = new ArrayList<Fj>();
		fjlist = inqOrderDao.getFjFile(inqId);
		return fjlist;
	}


	
	@Override
	public List<Fj> getVendorFile(String inqId, String vendorId) {
		List<Fj> fjlist = new ArrayList<Fj>();
		fjlist = inqOrderDao.getbjFile(inqId, vendorId);
		return fjlist;
	}


	
	@Override
	public void savePsResult(psInqRsult map) {
		
		inqOrderDao.saveInqOrder(map);
		
	}


	@Override
	public void saveInqVendorh(psInqRsult map) {
		inqOrderDao.saveInqVendorHeader(map);
	}


	@Override
	public void saveInqVendorl(psInqRsult map) {
		inqOrderDao.saveInqVendorl(map);
	}


	
	
}
